import { videodetail } from '@/api/video/video';
import * as types from '../types'
export default {
    namespaced: true,
    state:{
    },
    mutations:{
        [types.SET_COURSE_LIST](state,list){
            state.courseList = list;
        }
    },
    actions:{
        async [types.GET_VIDEO_DETAIL]({commit},id){
            let res = await videodetail(id)
            if (res.code === 0) {
                console.log('成功返回res:',res)
                // 返回视频地址
                return res.data;
            } else {
                // 获取失败
                return Promise.reject(res.data)
            }
        }
    }
}